/**
 * 
 */

/**
 * @author PRosa
 * 
 */
public class Sum10 {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		assert 1 != 2;
		// assert false;
		int result = sumToN(10);
		
		System.out.println( result);
	}
	static void showLoadingBar()
	{
		System.out.print("Loading");
		for (int i = 0; i < 5; i++) {
			System.out.print(".");
			Utils.pause(500);
		}
		System.out.println("Done");
	}
	static boolean sumToNTested = false;

	private static int sumToN(int n) {
		if (!sumToNTested) {
			sumToNTested = true;
			assert sumToN(0) == 0;
			assert sumToN(1) == 1;
			assert sumToN(2) == 3;
			assert sumToN(10) == 55;
		}
		int result = 0;
		for (int i = 1; i <= n; i++) {
			result += i;
		}
		return result;
	}

}
